"use strict";

// https://webpack.js.org/api/hot-module-replacement/
/**
 * @import { Compiler, RspackPluginInstance } from "@rspack/core";
 */

/**
 * @implements {RspackPluginInstance}
 */
class HotReplacementNg {
  /**
   * @param {string} str
   * @returns {string}
   */
  static camelCase(str) {
    return str.replaceAll(/[-_](\w)/g, (_, c) => c.toUpperCase());
  }

  /**
   * @param {Compiler} compiler
   */
  apply(compiler) {
    compiler.hooks.compilation.tap(HotReplacementNg.name, (compilation) => {
      // TODO
    });
  }
}

module.exports = { HotReplacementNg };
